<?php require APP_ROOT.'public/head.php'; if(session('member')=='')
{
    goto_url('index.php?m=member&a=login');
}?>
<?php
$lindind=session('lindind');

?>
    <link href="css/chunk-d77dd4c6.8a49d1d6.css"   rel="stylesheet" type="text/css" >
    <link href="css/chunk-vendors.0606ffef.css"   rel="stylesheet" type="text/css" >
    <link href="css/chunk-42c8bfd4.2b783b18.css" rel="stylesheet" type="text/css" >
    <div class="page">
        <?php require APP_ROOT.'public/top.php';?>
        <!---->
        <div class="home_kf">
            <p>微信客服
                <img src="images/kf.jpg" alt="" class="home_kf_code">
            </p>
        </div>
        <style>
            .home_kf_code{display: none;}
            .home_kf:hover .home_kf_code{display: block;}
        </style>
        <div class="page_body body_inputModel">
            <div class="batch_page page_body_content">
                <div class="input_model">
                    <?php $list=M('classify')->where(array('classify_id'=>213))->order('date asc')->find();?>
                    <div class="notice_bar">
                        <h1><?php echo $list['classify_name'];?></h1>
                        <p><?php echo $list['classify_intro'];?></p>
                    </div>
                    <div class="input_model_head">
                        请您根据步骤提示下单
                    </div>
                    <div class="flow_order">
                        <div class="flow_order_item flow_select">
                            <div class="flow_order_item_left">
                                <div class="flow_order_item_left_icon">
                                    <i class="el-icon-check" style="margin-top: 8px;"></i>
                                </div>
                                <div class="flow_order_item_left_line"></div>
                            </div>
                            <div class="flow_order_item_right">
                                <p class="flow_order_item_right_title">您选择的商品</p>
                                <?php $goods=M('goods')->where(array('goods_id'=>$goodsid))->find(); ?>
                                <input type="hidden" id="price" value="<?php echo $goods['price'];?>">
                                <input type="hidden" id="shumud" value="<?php echo count($lindind);?>">
                                <?php if(empty($goodsid)){ ?>
                                <div class="flow_order_item_right_block xuansdhua">
                                    +
                                </div>
                                <?php }else{ ?>
                                <div class="flow_order_item_right_commodity">
                                    <div class="flow_order_item_right_commodity_img">
                                        <img src="<?php echo $goods['goods_img'];?>" alt="" />
                                        <em class="delete_commodity"><i class="el-icon-delete" style="margin-top: 8px;"></i></em>
                                    </div>
                                    <div class="flow_order_item_right_message">
                                        <h6><?php echo $goods['goods_name'];?></h6>
                                        <p> 价格：<span><?php echo $goods['price'];?></span></p>
                                    </div>
                                </div>
                                <?php } ?>
                            </div>
                        </div>
                        <div class="flow_order_item flow_select">
                            <div class="flow_order_item_left">
                                <div class="flow_order_item_left_icon">
                                    <i class="el-icon-check" style="margin-top: 8px;"></i>
                                </div>
                                <div class="flow_order_item_left_line"></div>
                            </div>
                            <div class="flow_order_item_right">
                                <p class="flow_order_item_right_title">请选择您收件人信息的数据来源</p>
                                <ul class="flow_order_source">
<?php $shouxin=M()->table('index_shouxin n,index_relevance r')->where('r.classify_id =214 and r.content_id=n.shouxin_id')->order('date desc')->find();?>
                                    <input type="hidden" name="shouxin_id" id="shouxin_id" value="<?php echo $shouxin['shouxin_id'];?>">
<?php $shouxin=M()->table('index_shouxin n,index_relevance r')->where('r.classify_id =214 and r.content_id=n.shouxin_id')->order('date desc')->select();foreach($shouxin as $k=>$v){?>
                                    <li class="<?php if($k==0){ echo 'flow_order_source_active';} ?>" data-id="<?php echo $v['shouxin_id'];?>">
                                        <div class="flow_order_source_img">
                                            <img style="max-height: 100%;max-width: 100%;" src="<?php echo $v['shouxin_img'];?>" alt="" />
                                        </div><p class="flow_order_source_title selectSource"><?php echo $v['shouxin_name'];?></p>
                                    </li>
<?php }?>
                                </ul>
                            </div>
                        </div>
                        <div class="flow_order_item flow_active">
                            <div class="flow_order_item_left">
                                <div class="flow_order_item_left_icon">
                                    <span>3</span>
                                </div>
                                <div class="flow_order_item_left_line"></div>
                            </div>
                            <div class="flow_order_item_right">
                                <p class="flow_order_item_right_title">填写收件人地址</p>
                                <div class="flow_order_address">
                                    <div role="radiogroup" class="el-radio-group">
                                        <label role="radio" aria-checked="true" tabindex="0" class="el-radio-button el-radio-button--small is-active"><input type="radio" name="address_type" tabindex="-1" class="el-radio-button__orig-radio" value="1" /><span class="el-radio-button__inner">地址模板
                                                <!----></span></label>
                                    </div>

                                    <table class="flow_order_address_table">
                                        <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>订单编号</th>
                                            <th>姓名</th>
                                            <th>电话</th>
                                            <th>地址</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <?php
                                        foreach ($lindind as $k=>$v){
                                            $zifsa = explode("，",$v);
                                            ?>
                                            <tr title="" class="">
                                                <td><?php echo $k+1; ?></td>
                                                <td><?php echo $zifsa[0]; ?></td>
                                                <td><?php echo $zifsa[1]; ?></td>
                                                <td><?php echo $zifsa[2]; ?></td>
                                                <td><?php echo $zifsa[3]; ?></td>
                                                <td><span class="table_delete" onclick="shuhdsa(<?php echo $k; ?>);">删除</span></td>
                                            </tr>
                                            <?php
                                        }
                                        ?>
                                        <tbody>
                                        </tbody>
                                    </table>
                                    <!---->
                                    <p class="flow_order_address_tip">格式要求：</p>
                                    <p class="flow_order_address_tip"><span style="color: rgb(255, 0, 0);"> 订单编号，姓名，电话，地址 </span>&nbsp;按顺序填写，中间用逗号分隔 </p>
                                    <p class="flow_order_address_tip">示例：123456789，李三，13366666666，浙江省 杭州市 滨江区 滨盛路N号</p>
                                    <p class="flow_order_address_tip" style="color: rgb(255, 0, 0);">（注：订单编号非必填项，也可不填写）</p>
                                    <p class="flow_order_address_tip" style="color: rgb(255, 0, 0);">（注：地址省市区空格，复制地址没有空格，可以不空）</p>
                                    <div class="flow_order_address_textarea">
                                        <p>收件人,</p>
                                        <textarea id="huibisdh" rows="" cols="" placeholder="订单编号,姓名,电话,地址
订单编号,姓名,电话,地址
吉林省暂不发货"></textarea>
                                        <button type="button" class="el-button flow_order_address_textarea_but el-button--primary jydsda">
                                            <!---->
                                            <!----><span>完成添加</span></button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="flow_order_item">
                            <div class="flow_order_item_left">
                                <div class="flow_order_item_left_icon">
                                    <span>4</span>
                                </div>
                            </div>
                            <div class="flow_order_item_right">
                                <p class="flow_order_item_right_title">确认提交</p>
                                <div class="flow_order_message">
                                    <p class="count_number"> 总单数： <span class="jianshu">0</span> 件 </p>
                                    <p class="all_price"> 总价格： <span class="zongshu">0</span> 元 </p>
                                    <!---->
                                </div>
                                <button type="button" class="el-button el-button--primary el-button--small qusdisass">
                                    <!---->
                                    <!----><span>确认提交</span></button>
                            </div>
                        </div>
                    </div>
                    <div class="el-dialog__wrapper" style="z-index: 2002;display: none;">
                        <div role="dialog" aria-modal="true" aria-label="订单确认" class="el-dialog" style="margin-top: 15vh; width: 500px;">
                            <div class="el-dialog__header">
                                <span class="el-dialog__title">订单确认</span>
                                <button type="button" aria-label="Close" class="el-dialog__headerbtn"><i class="el-dialog__close el-icon el-icon-close dhsui1"></i></button>
                            </div>
                            <div class="el-dialog__body">
                                <div class="order_confirm">
                                    <div class="order_confirm_img">
                                        <img style="max-width: 100%;max-height: 100%;" src="<?php echo $goods['goods_img'];?>" alt="" />
                                    </div>
                                    <div class="order_confirm_commodity">
                                        <p>单&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;价： <span class="order_confirm_commodity_price zxczxc1"><?php echo $goods['price'];?></span> 元</p>
                                        <p>总&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;计： <span class="zxczxc2"><?php echo count($lindind);?></span>件</p>
                                        <p>费&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;用： <span class="order_confirm_commodity_money  zxczxc3"></span> 元</p>
                                        <!---->
                                    </div>
                                    <!---->
                                </div>
                            </div>
                            <!---->
                            <div class="el-dialog__footer">
         <span class="dialog-footer"><button type="button" class="el-button el-button--default dhsui1">
           <!---->
                 <!----><span>取 消</span></button><button type="button" class="el-button el-button--primary  shengcd">
           <!---->
                 <!----><span>确 定</span></button></span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div tabindex="-1" role="dialog" aria-modal="true" aria-label="dialog" class="el-message-box__wrapper" style="z-index: 2003;display: none;">
        <div class="el-message-box">
            <div class="el-message-box__header">
                <div class="el-message-box__title">
                    <!---->
                    <span></span>
                </div>
                <button type="button" aria-label="Close" class="el-message-box__headerbtn"><i class="el-message-box__close el-icon-close dhsui1"></i></button>
            </div>
            <div class="el-message-box__content">
                <div class="el-message-box__container">
                    <!---->
                    <div class="el-message-box__message">
                        <p>要删除这件商品？</p>
                    </div>
                </div>
                <div class="el-message-box__input" style="display: none;">
                    <div class="el-input">
                        <!---->
                        <input type="text" autocomplete="off" placeholder="" class="el-input__inner" />
                        <!---->
                        <!---->
                        <!---->
                        <!---->
                    </div>
                    <div class="el-message-box__errormsg" style="visibility: hidden;"></div>
                </div>
            </div>
            <div class="el-message-box__btns">
                <button type="button" class="el-button el-button--default el-button--small dhsui1">
                    <!---->
                    <!----><span> 取消 </span></button>
                <button type="button" class="el-button el-button--default el-button--small el-button--primary ghsudha">
                    <!---->
                    <!----><span> 确定 </span></button>
            </div>
        </div>
    </div>
    <div class="v-modal" style="z-index: 99;display: none;" tabindex="0"></div>
<style>
    .all_price span {font-size: 20px;color: var(--red-color);}
    .count_number span {font-size: 14px;color: var(--red-color);}
</style>
<script>
    $('.shengcd').click(function(){
        var url="index.php?m=order&a=shencdind";
        var data={
            'shouxin_id':$('#shouxin_id').val(),
        }
        $.post(url,data,function(d){
            if(d==1){
                window.location.reload();
            }else{
                alert(d);
            }
        });
    });
    $('.qusdisass').click(function(){
        //alert(11);
         if($('#price').val()=='' || $('#shumud').val()==''){
             alert("请先完成前面的步骤");return false;
         }else{
             $('.el-dialog__wrapper').css('display','block');
             $('.v-modal').css('display','block');
         }
    });
</script>


        <script>
            $('.ghsudha').click(function(){
                var url="index.php?m=Index&a=qingchu";
                var data={
                }
                $.post(url,data,function(d){
                    window.location.reload();
                });
            });
            $('.dhsui1').click(function() {
                window.location.reload();
            });
        </script>
<script>

    window.setInterval("jisuans()",1000);
    function jisuans() {
        var qian=$('#price').val();
        var shu=$('#shumud').val();
        var zong=qian*shu;
        if(shu=='' || qian==''){
            $('.jianshu').html(0);
            $('.zongshu').html(0);
        }else{
            $('.jianshu').html(shu);
            $('.zongshu').html(zong);
            $('.zxczxc3').html(zong);
        }


    }
    function shuhdsa(id){
        var url="index.php?m=Index&a=dindans2";
        var data={
            'data1':id,
        }
        $.post(url,data,function(d){
            $('.flow_order_address_table').html(d);
        });
    }
    $('.jydsda').click(function(){
        if($('#huibisdh').val()==''){
            alert("请添加地址");return false;
        }else{
            var url="index.php?m=Index&a=dindans";
            var data={
                'data1':$('#huibisdh').val(),
            }
            $.post(url,data,function(d){
                $('.flow_order_address_table').html(d);
            });
        }
    });
    $('.delete_commodity').click(function(){
        $('.el-message-box__wrapper').css('display','block');
        $('.v-modal').css('display','block');
    });
    $('.flow_order_source li').click(function(){
        var id=$(this).attr('data-id');
        $('.flow_order_source li').removeClass('flow_order_source_active');
        $(this).addClass('flow_order_source_active');
        $('#shouxin_id').val(id);
    });
    $('.xuansdhua').click(function(){
        window.location.href="index.php";
    });
</script>




<?php require APP_ROOT.'public/bottom.php';?>